Skip to content

[gmp] Cleanup, fix cross-builds, switch windows from yasm to clang#27787

Merged
BillyONeal merged 12 commits intomicrosoft:masterfrom
dg0yt:gmp
Nov 18, 2022
Merged

[gmp] Cleanup, fix cross-builds, switch windows from yasm to clang#27787
BillyONeal merged 12 commits intomicrosoft:masterfrom
dg0yt:gmp

Conversation

@dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Nov 12, 2022

@dg0yt dg0yt force-pushed the gmp branch 2 times, most recently from f8842e7 to 1ee0428 Compare November 12, 2022 17:41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to not add this to PATH and keep the patch smaller ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@Neumann-A Neumann-A Nov 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason to add it to the path is again the spaces issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. But I wonder if space wouldn't cause problems in 200 other spots.
(I was already thinking about a PR which builds in /v pkg to see what breaks.)

I will check if I can use proper quotes.

Copy link
Contributor Author

@dg0yt dg0yt Nov 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gmp install step fails anyways when the install root or packages root contains space, and there is a warning:

CMake Warning at scripts/cmake/vcpkg_configure_make.cmake:203 (message):
  Detected whitespace in root directory.  Please move the path to one without
  whitespaces! The required tools do not handle whitespaces correctly and the
  build will most likely fail

The gmp build step fails anyways when the buildtrees contains space.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 7428e7a..af37ffd 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2690,7 +2690,7 @@
     },
     "gmp": {
       "baseline": "6.2.1",
-      "port-version": 13
+      "port-version": 14
     },
     "gmsh": {
       "baseline": "4.9.0",
diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json
index 8fd6673..b301b77 100644
--- a/versions/g-/gmp.json
+++ b/versions/g-/gmp.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "ff8dea9499f7141be457b57c4fef949a29aa941d",
+      "version": "6.2.1",
+      "port-version": 14
+    },
     {
       "git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
       "version": "6.2.1",

You have modified or added at least one portfile where deprecated functions are used.

Details

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/gmp/portfile.cmake

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 7428e7a..af37ffd 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2690,7 +2690,7 @@
     },
     "gmp": {
       "baseline": "6.2.1",
-      "port-version": 13
+      "port-version": 14
     },
     "gmsh": {
       "baseline": "4.9.0",
diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json
index 8fd6673..b45b8c2 100644
--- a/versions/g-/gmp.json
+++ b/versions/g-/gmp.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "e8d9f78bbb94c735ce2a7d1f644dd552e20aebd4",
+      "version": "6.2.1",
+      "port-version": 14
+    },
     {
       "git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
       "version": "6.2.1",

You have modified or added at least one portfile where deprecated functions are used.

Details

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/gmp/portfile.cmake

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 7428e7a..af37ffd 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2690,7 +2690,7 @@
     },
     "gmp": {
       "baseline": "6.2.1",
-      "port-version": 13
+      "port-version": 14
     },
     "gmsh": {
       "baseline": "4.9.0",
diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json
index 8fd6673..cb1e324 100644
--- a/versions/g-/gmp.json
+++ b/versions/g-/gmp.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "254ac1c99afc24f08c0932cb59d8a502785bc3fe",
+      "version": "6.2.1",
+      "port-version": 14
+    },
     {
       "git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
       "version": "6.2.1",

You have modified or added at least one portfile where deprecated functions are used.

Details

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/gmp/portfile.cmake

github-actions[bot]
github-actions bot previously approved these changes Nov 13, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one portfile where deprecated functions are used.

Details

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/gmp/portfile.cmake

@dg0yt dg0yt changed the title [gmp] Cleanup, fix cross-builds [gmp] Cleanup, fix cross-builds, switch windows from yasm to clang Nov 13, 2022
@dg0yt dg0yt marked this pull request as ready for review November 13, 2022 13:25
Comment on lines 8 to +12
if test "$enable_shared" = yes; then
GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
- GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
- LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
- LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
+ #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
+ #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
+ GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm does the symbol export still work without these ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this with mingw-dynamic: The import libs are present and not empty, only smaller (in particular the C++ lib).
AFAIU from the headers, there should be enough export declarations for the public API. Only the tests, fuzzers etc. might need some symbols which are not covered. But vcpkg doesn't build them.
And the package even takes care of putting the right definitions into the header for DLL import. Maybe this is why they don't allow simultaneous shared+static for Windows.

# Flags used for preprocessing (in ansi2knr rules).
diff --git a/tests/Makefile.in b/tests/Makefile.in
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Makefile.in is generated from Makefile.am.

Comment on lines 8 to +12
if test "$enable_shared" = yes; then
GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
- GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
- LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
- LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
+ #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
+ #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
+ GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this with mingw-dynamic: The import libs are present and not empty, only smaller (in particular the C++ lib).
AFAIU from the headers, there should be enough export declarations for the public API. Only the tests, fuzzers etc. might need some symbols which are not covered. But vcpkg doesn't build them.
And the package even takes care of putting the right definitions into the header for DLL import. Maybe this is why they don't allow simultaneous shared+static for Windows.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one portfile where deprecated functions are used.

Details

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/gmp/portfile.cmake

@Adela0814 Adela0814 added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist category:port-bug The issue is with a library, which is something the port should already support labels Nov 14, 2022
@Cheney-W Cheney-W added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Nov 18, 2022
@BillyONeal BillyONeal merged commit e461f6d into microsoft:master Nov 18, 2022
@BillyONeal
Copy link
Member

Thanks for the gmp fixes! Happy to see yasm go bye bye bye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[gmp] Build error on x64-linux-dynamic

5 participants